<?php

class Index extends My_Controller {

    public function __construct() {
        parent::__construct();
    }

    public function index() {
        // Add title
        $this->template->add_title('Home page');

        // Add CSS and JS
        $this->template->add_css('public/default/css/style.css');
        $this->template->add_js('public/default/js/menu.js');

        // Build data
        $data['info'] = array(
            '0' => array(
                'id' => '001',
                'name' => 'kevin',
                'age' => '20',
                'result' => array(
                    '0' => array(
                        'point1' => 9,
                        'point2' => 8,
                        'point3' => 7
                    )
                )
            ),
            '1' => array(
                'id' => '002',
                'name' => 'kenny',
                'age' => '20',
                'result' => array(
                    '0' => array(
                        'point1' => 7,
                        'point2' => 8,
                        'point3' => 9
                    )
                )
            )
        );
        // Parser data
        $this->template->parse_view('content', 'default/block/content', $data);

        // Render template
        $this->template->render();
    }

}